<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>权限列表</title>
    <link rel="shortcut icon" href="__ADMIN__/images/favicon.ico">
    <link href="__ADMIN__/assets/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="__ADMIN__/assets/css/font-awesome.min.css" />
    <link rel="stylesheet" href="__ADMIN__/assets/css/ace.min.css" />
    <link rel="stylesheet" href="__ADMIN__/assets/css/ace-rtl.min.css" />
    <link rel="stylesheet" href="__ADMIN__/assets/css/ace-skins.min.css" />
    <link rel="stylesheet" href="__ADMIN__/css/style.css" />
    <link rel="stylesheet" href="__ADMIN__/css/node.css" />
    <script src="__ADMIN__/js/jquery-1.9.1.min.js"></script>
</head>
<script type="text/javascript">
    $(function(){
    	$("input[level=1]").click(function () {
            var inputs = $(this).parents(".app").find("input");
            $(this).prop('checked')?inputs.attr('checked','checked'):inputs.removeAttr('checked');
	    })
	    $("input[level=2]").click(function () {
            
		    var inputs = $(this).parents("dl").find("input");
		    $(this).prop('checked')?inputs.attr('checked','checked'):inputs.removeAttr('checked');
	    })
    });
</script>
<body>
    <div class="crumbs">
        <ul>
            <li>
                <a href="javascript:;" class="active">权限配置</a>
            </li>
        </ul>
    </div>
    <div id="wrap">
        <a href="{:url('Rbac/role')}" class="add-app">返回</a>
        <form action="{:url('rbac/access')}" method="post">
            {volist name="page_data" id="app"}
            <div class="app">
                <p>
                    <strong>{$app.title}</strong>
                    <input type="checkbox" name="access[]" value="{$app.id}_1" level="1" {if condition="$app['access'] eq 1" } checked="checked"
                        {/if}>
                </p>
                {volist name="app.child" id="action"}
                <dl>
                    <dt>
                        <strong>{$action.title}</strong>
                        <input type="checkbox" name="access[]" value="{$action.id}_2" level="2" {if condition="$action['access'] eq 1" } checked="checked"
                            {/if}>
                    </dt>
                    {volist name="action.child" id="method"}
                    <dd>
                        <span>{$method.title}</span>
                        <input type="checkbox" name="access[]" value="{$method.id}_3" level="3" {if condition="$method['access'] eq 1" } checked="checked"
                            {/if}>
                    </dd>
                    {/volist}
                </dl>
                {/volist}
            </div>
            {/volist}
            <input type="hidden" name="rid" value="{$rid}">
            <input type="submit" class="btn btn-primary radius submit" value="保存修改">
        </form>
    </div>
</body>

</html>
<style>
    .submit{
        width:80px;margin:10px auto 0;display: flex;align-content: center;
    }
</style>